//
//  LGNetworkTools.m
//  lgdw
//
//  Created by Apple on 15/12/8.
//  Copyright © 2015年 Apple. All rights reserved.
//

#import "LGNetworkTools.h"

@implementation LGNetworkTools
+ (instancetype)sharedManager {
    
    static LGNetworkTools *instance = nil;
    
  
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        NSURL *baseUrl = [NSURL URLWithString:@"http://api.duwu.me"];
        NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration];
        // 设置超时时长
        config.timeoutIntervalForRequest = 15;
        
        instance = [[self alloc] initWithBaseURL:baseUrl sessionConfiguration:config];
        
        instance.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/html", nil];
//        instance.responseSerializer.acceptableContentTypes = [instance.responseSerializer.acceptableContentTypes setByAddingObject:@"text/html"];
        
        
    });
    
    return instance;
}




@end
